package com.changpei.search.feign;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.changpei.common.result.Result;
import com.changpei.search.pojo.CommentIndex;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 *
 * <p>Title : CommentIndexFeign</p>
 * <p>Description : commentIndexFeign</p>
 * @author weibiao
 */
@FeignClient(name = "search")
@RequestMapping("/commentIndex")
public interface CommentIndexFeign {

    /**
     *
     * <p>Title : add</p>
     * <p>Description : 新增CommentIndex数据</p>
     * @param commentIndex
     * @return
     */
    @PostMapping(value = "/add")
    Result<String> add(@RequestBody(required = false) CommentIndex commentIndex);

    /**
     *
     * <p>Title : delete</p>
     * <p>Description : CommentIndex根据ID主键删除数据</p>
     * @param id
     * @return
     */
    @DeleteMapping(value = "/{id}")
    Result<String> delete(@PathVariable(required = false) Long id);

    /**
     *
     * <p>Title : update</p>
     * <p>Description : CommentIndex根据ID修改</p>
     * @param commentIndex
     * @param id
     * @return
     */
    @PutMapping(value = "/{id}")
    Result<String> update(@RequestBody CommentIndex commentIndex, @PathVariable Long id);

    /**
     *
     * <p>Title : findPage</p>
     * <p>Description : CommentIndex分页搜索实现</p>
     * @param pageNum : 当前页
     * @param pageSize : 每页显示多少条
     * @return
     */
    @GetMapping(value = "/{pageNum}/{pageSize}")
    Result<Page<CommentIndex>> findPage(@PathVariable int pageNum, @PathVariable int pageSize);

    /**
     *
     * <p>Title : findPage</p>
     * <p>Description : CommentIndex分页搜索实现</p>
     * @param pageNum : 当前页
     * @param pageSize : 每页显示多少条
     * @param commentIndex
     * @return
     */
    @PostMapping(value = "/{pageNum}/{pageSize}")
    Result<Page<CommentIndex>> findPage(@RequestBody(required = false) CommentIndex commentIndex, @PathVariable int pageNum, @PathVariable int pageSize);

}